Skip to content

chore: update daemonset to use resource processor#46

Open
sleepyfoodie wants to merge 3 commits intomainfrom
sk/update-daemonset-to-use-resources-processor
Open

chore: update daemonset to use resource processor#46
sleepyfoodie wants to merge 3 commits intomainfrom
sk/update-daemonset-to-use-resources-processor

Conversation

@sleepyfoodie
Copy link
Collaborator

No description provided.


CLUSTER_NAME="${CLUSTER_NAME:-queries-testing}"
KWOK_CONTEXT="kwok-${CLUSTER_NAME}"
KWOK_NET="kwok-${CLUSTER_NAME}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used in line 82

@sleepyfoodie sleepyfoodie marked this pull request as ready for review February 20, 2026 23:04
@sleepyfoodie sleepyfoodie requested a review from skl as a code owner February 20, 2026 23:04
Copilot AI review requested due to automatic review settings February 20, 2026 23:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the OpenTelemetry collector daemonset configuration to use the resource processor instead of the attributes processor for setting the k8s.cluster.name attribute. Additionally, it includes dependency updates for the kwok-stats-proxy module, a Go version upgrade, and improvements to the cleanup scripts.

Changes:

  • Updated OpenTelemetry processor from attributes/k8sclustername to resource/k8sclustername in the daemonset configuration
  • Updated Go dependencies (golang.org/x/net, gopkg.in/evanphx/json-patch.v4, k8s.io/kube-openapi, go.yaml.in/yaml/v2)
  • Upgraded base image from golang:1.25 to golang:1.26 in kwok-stats-proxy Dockerfile
  • Enhanced cleanup scripts with network-based container removal and additional container names

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/otel-collector-daemonset.values.yaml Changed processor type from attributes to resource for k8s.cluster.name
scripts/kwok-stats-proxy/go.mod Updated Go version to 1.26.0 and removed unused pkg/errors dependency
scripts/kwok-stats-proxy/go.sum Updated dependency checksums for version bumps
scripts/kwok-stats-proxy/Dockerfile Upgraded golang base image to 1.26 and removed SHA256 digest pin
scripts/run-kwok-env.sh Added KWOK_NET variable for consistent network naming
Makefile Enhanced cleanup to include kwok-otel-gateway and network-based container removal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to 56
resource/k8sclustername:
attributes:
- key: k8s.cluster.name
action: upsert
value: kubernetes-mixin-otel
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The processor name has been updated from attributes/k8sclustername to resource/k8sclustername in this file, but the same processor in scripts/kwok-config/kwok-hostmetrics-replicator.yaml (lines 35-39 and 61) still uses the old attributes/k8sclustername name. This inconsistency could cause configuration errors. Both files should use the same processor type for setting the cluster name attribute.

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
FROM golang:1.25-alpine@sha256:98e6cffc31ccc44c7c15d83df1d69891efee8115a5bb7ede2bf30a38af3e3c92 AS builder
FROM golang:1.26-alpine AS builder
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SHA256 digest pin has been removed from the FROM instruction. This makes the build less reproducible and could introduce supply chain security risks, as the image tag could potentially point to different content over time. Consider keeping the digest pin for better security and reproducibility, especially for production builds.

Suggested change
FROM golang:1.26-alpine AS builder
FROM golang:1.26-alpine@sha256:<exact-digest-for-golang-1.26-alpine> AS builder

Copilot uses AI. Check for mistakes.
@docker rm -f kwok-otel-collector kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true
@for c in $$(docker ps -a -q --filter "name=kwok-hostmetrics-replicator" 2>/dev/null); do docker rm -f $$c 2>/dev/null || true; done
@docker rm -f kwok-otel-collector kwok-otel-gateway kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true
@for c in $$(docker ps -a -q --filter "name=kwok-hostmetrics" 2>/dev/null); do docker rm -f $$c 2>/dev/null || true; done
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter pattern has been changed from "name=kwok-hostmetrics-replicator" to "name=kwok-hostmetrics". This is a broader filter that will match any container name starting with "kwok-hostmetrics", including "kwok-hostmetrics-replicator" and potentially other containers. Ensure this is intentional and that you want to clean up all containers matching this pattern, not just the replicator containers.

Suggested change
@for c in $$(docker ps -a -q --filter "name=kwok-hostmetrics" 2>/dev/null); do docker rm -f $$c 2>/dev/null || true; done
@for c in $$(docker ps -a -q --filter "name=kwok-hostmetrics-replicator" 2>/dev/null); do docker rm -f $$c 2>/dev/null || true; done

Copilot uses AI. Check for mistakes.
kwok-down:
@docker rm -f kwok-otel-collector kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true
@for c in $$(docker ps -a -q --filter "name=kwok-hostmetrics-replicator" 2>/dev/null); do docker rm -f $$c 2>/dev/null || true; done
@docker rm -f kwok-otel-collector kwok-otel-gateway kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup now includes removal of a 'kwok-otel-gateway' container, but there are no references to this container being created in any of the scripts in the repository. If this container is created elsewhere or is planned for future use, this is fine. Otherwise, this cleanup step may be unnecessary.

Suggested change
@docker rm -f kwok-otel-collector kwok-otel-gateway kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true
@docker rm -f kwok-otel-collector kwok-stats-proxy kwok-beyla lgtm 2>/dev/null || true

Copilot uses AI. Check for mistakes.
Copy link
Member

@skl skl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sleepyfoodie please check the copilot suggestions, they seem reasonable. Feel free to ping me when ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants